const db = require("../../models/index");
exports.create = async (obj) => {
  try {
  const data = {};
  data[`${obj.key}`] = obj.value;
  console.log(data)
  const comment = await db.model_comment_F.findAll({
    where: data,
    attributes: ["comment_id"],
  });
  if (comment.length) {
    for (let index = 0; index < comment.length; index++) {
      console.log("删除了评论：" + comment[index].comment_id);
    }
    await db.model_comment_F.destroy({
      where: data,
    });
    return comment;
  }
  return false;
} catch (error) {
  console.log(error)
  return error
}
};
